package cn.kongwg.juc;

import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;

/**
 * @author kongwg
 * @create 2021-05-03 12:51
 */
public class FunctionDemo {
    public static void main(String[] args) {
        Consumer consumer = (item)->{
            System.out.println(item);
        };
        consumer.accept("lallalal");

        Supplier supplier = ()->{
            return "lalallakkk";
        };
       System.out.println("supplier = " + supplier.get());
        Function function = (item)->{
            return 123;
        };
        System.out.println(function.apply("lala"));;

        Predicate<String> predicate = (item)->{
            return item.isEmpty();};
        System.out.println(predicate.test(""));

    }
}
